<?php 
$tags = unserialize(A_HCS);
$opts = new stdClass();
$opts->cd = 't.tag_id LIKE :v1';
$opts->cdv = array(':v1' => '%,' . A_HC . ',%');
$rslt = $orm->get('pb_ecom_article', 't.date', 'DESC', NULL, NULL, $opts)->d;

$data = array();
foreach ($tags as $itm) {
  $obj = new stdClass();
  $obj->title = $itm;
  $obj->posts = array();
  $data[] = $obj;
  foreach ($rslt as $itm2) {
    if (strpos($itm2->tag_id, ",$itm,") != false) {
      $obj->posts[] = $itm2;
    }
  }
}
?>

<style>
table.help {
  width: 950px;
  margin: 0 auto;
  color: #fff;
}
table.help * {
  font-size: 12px;
}
table.help td {
  vertical-align: top;
  text-align: left;
}
table.help td.main {
  width: 15%;
}
table.help a {
  font-family: Lucida Sans Unicode !important;
  color: #fff;
}
table.help div {
  font-family: Lucida Sans Unicode !important;
  font-weight: bold;
}
table.help ul {
  padding: 0;
  margin: 0;
  margin-left: 10px;
  margin-top: 5px;
  list-style-type: none;
}
table.help li {
  margin: 0;
  padding: 3px 0;
}
table.help img {
  height: 120px;
}
</style>
<div>&nbsp;</div>
<table class="help" cellpadding=0 cellspacing=0>
  <tr>
    <td class="main" style="text-align: center;">
      <div>Pozo安全认证</div>
      <img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/secure.png"></img>
    </td>
    <td style="padding: 0 10px;"><img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/line.jpg"></img></td>
    <td class="main">
      <div>网站内容</div>
      <ul>
        <?php foreach ($app_data->pages as $itm) { ?>
          <?php if ($itm->parent_id == 0 && $itm->is_visible == 1) { ?>
          <li><a href="#" onclick="return Url.redirect(____redmd, ____sys + '.php?i=<?php echo $itm->id; ?>');"><?php echo $itm->name; ?></a></li>
          <?php }?>
        <?php } ?>
      </ul>
    </td>
    <td style="padding: 0 10px;"><img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/line.jpg" alt=""></img></td>
    <?php foreach ($data as $idx => $itm) { ?>
      <td class="main">
        <div><?php echo $itm->title; ?></div>
        <ul>
          <?php foreach ($itm->posts as $itm2) { ?>
            <li><a href="#" onclick="return Url.redirect(____redmd, ____sys + '.php?i=<?php echo ECOM_ART_ID; ?>&__file=index_article&id=<?php echo $itm2->id; ?>&cat=<?php echo A_HC; ?>');""><?php echo $itm2->title; ?></a></li>
          <?php } ?>
        </ul>
      </td>
      <?php if ($idx < (count($tags) - 1)) { ?>
      <td style="padding: 0 10px;"><img src="<?php echo TH_DIR . basename(dirname(__FILE__)); ?>/skin/images/line.jpg" alt=""></img></td>
      <?php } ?>
    <?php } ?>
  </tr>
</table>
